package org.jimotozka.contactmanager.service;

import java.util.List;

import org.jimotozka.contactmanager.dao.ContactDAO;
import org.jimotozka.contactmanager.domain.Contact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class ContactServiceImplementation implements ContactService{

	@Autowired
	private ContactDAO contactDao;
	
	@Transactional
	@Override
	public void addContact(Contact contact) {
		contactDao.addContact(contact);
	}

	@Transactional
	@Override
	public List<Contact> listContact() {
		return contactDao.listContact();
	}

	@Transactional
	@Override
	public void removeContact(Integer id) {
		contactDao.removeContact(id);
	}
	
}
